

<!-- 帮助与客服 -->
<template>
	<view class="container">
		
		<!-- header部分 -->
		<view class='header-Container header-height'>
			<view @click="back()" class="leftBtns">
				<image class="back" :src="icon.backBtn"></image>
			</view>
			<view class="title" style="z-index: 3;">帮助与客服</view>
			<view class="rightBtns">
				<image @click="gotoContactSell()" class="service" :src="icon.serviceBtn"></image>
			</view>
		</view>
		
		<view class="oneRow" v-for="(item,index) of list">
			<view class="list-cell radiusT10" :class="currentIndex == index ? 'b-b':'radiusTB10'" @click="showHideLevel2(index)">
				<text class="cell-tit leave1" :class="currentIndex == index ? 'current':''">{{item.name}}</text>
				<image v-if="currentIndex == index" class="upIcon" :src="icon.upIcon" mode=""></image>
				<image v-else class="downIcon" :src="icon.downIcon" mode=""></image>
			</view>
			<view class="level2-Container" v-for="(item2,index2) of item.v2HelpCenterForms" :class="currentIndex == index ? '':'hiddenLevel2'">
				<view :class="item.v2HelpCenterForms.length-1 == index2?'list-cell radiusB10':'list-cell b-b'" @click="toRich(item2.helpLabel,item2.helpContent)">
					<text class="cell-tit leave2">{{item2.helpLabel}}</text>
					<image class="rightIcon" :src="icon.rightIcon" mode=""></image>
				</view>
			</view>
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				icon: {
					backBtn: "/static/images/common/return.png",
					serviceBtn: "/static/images/user/helpService/serviceBtn.png",
					downIcon: "/static/images/user/helpService/downIcon.png",
					upIcon: "/static/images/user/helpService/upIcon.png",
					rightIcon: "/static/images/user/helpService/rightIcon.png"
				},
				
				currentIndex: 0,
				
				list:[],
				
				
				phoneNumber: "",
			};
		},
		onLoad() {
			let that = this;
			that.$api.globalUtil.requestAjax({
				url: '/helpCenterApi/getHelpCenterListApi',
				method: 'POST',
				success: function(res) {
					that.list = res.data.response;
				}
			});
		},
		methods: {
			
			back() {
				uni.navigateBack({
				});
			},
			
			//显示隐藏二级
			showHideLevel2(leave1) {
				if(this.currentIndex == leave1) {
					this.currentIndex = -1;
				}else {
					this.currentIndex = leave1;
				}
			},
			toRich(title,text){
				uni.navigateTo({
					url: '/pages/utilPage/richText?text='+text+'&title='+title
				})
			},
			
			
			//咨询客服
			gotoContactSell() {
				this.$api.globalUtil.gotoContactSell();
			}
		}
	}
</script>

<style lang="scss">
	page{
		background: #F5F5F5;
	}
	
	// header部分
	.header-Container {
		// position: relative;
		// width: 100%;
		height: 176rpx;
		overflow: hidden;
		box-shadow: 0px 1px 1px 0px rgba(0, 0, 0, 0.08);
		background: rgba(255, 255, 255, 1);
	
		.leftBtns {
			z-index: 999;
			display: flex;
			align-items: center;
			justify-content: flex-start;
			position: absolute;
			bottom: 0;
			// width: 100%;
			height: 86rpx;
	
			.back {
				margin-left: 17rpx;
				width: 44rpx;
				height: 44rpx;
			}
		}
	
		.title {
			position: absolute;
			bottom: 0;
			width: 100%;
			height: 86rpx;
			line-height: 86rpx;
			text-align: center;
			font-size: 36rpx;
			font-family: PingFang SC;
			font-weight: bold;
			color: rgba(51, 51, 51, 1);
		}
		
		.rightBtns {
			z-index: 99;
			display: flex;
			align-items: center;
			justify-content: flex-end;
			position: absolute;
			bottom: 0;
			width: 100%;
			height: 86rpx;
		}
		
		.service {
			margin-right: 30rpx;
			width: 38rpx;
			height: 38rpx;
		}
	}
	
	.container {
		.oneRow {
			margin-top: 20rpx;
			padding: 0 30rpx;
			border-radius: 10rpx;
			
			.radiusT10 {
				border-radius: 10rpx 10rpx 0 0;
			}
			.radiusB10 {
				border-radius: 0 0 10rpx 10rpx;
			}
			
			.radiusTB10 {
				border-radius: 10rpx;
			}
			
			.downIcon, .upIcon {
				width: 22rpx;
				height: 12rpx;
			}
			
			.rightIcon {
				width: 12rpx;
				height: 22rpx;
			}
			
			
			.cell-tit.leave1 {
				font-size:28rpx;
				font-family:PingFang;
				font-weight:bold;
				color:rgba(51,51,51,1);
			}
			.cell-tit.current {
				color: #D10C20;
			}
			
			.cell-tit.leave2 {
				padding-left: 30rpx;
				font-size:26rpx;
				font-family:PingFang;
				// font-weight:500;
				color:rgba(102,102,102,1);
			}
			
			.hiddenLevel2 {
				display: none;
			}
		}
	}
	.list-cell{
		display:flex;
		align-items:center;
		padding: 0 30rpx 0 30rpx;
		height: 106rpx;
		line-height:106rpx;
		position:relative;
		background: #fff;
		justify-content: center;
		
		input {
			text-align: right;
			color: #333333;
		}
		
		.inputHolder {
			font-size:28rpx;
			font-family:PingFang;
			// font-weight:500;
			color:rgba(153,153,153,1);
			line-height:55px;
		}
		
		&.cell-hover{
			background:#fafafa;
		}
		&.b-b:after{
			left: 30rpx;
			right: 30rpx;
		}
		&.m-t{
			margin-top: 16upx; 
		}
		.cell-more{
			align-self: baseline;
			font-size:$font-lg;
			color:$font-color-light;
			margin-left:10upx;
		}
		.cell-tit{
			flex: 1;
			margin-right:10upx;
			font-size:28rpx;
			font-family:PingFang;
			/* font-weight:500; */
			color:#333333;
		}
		.cell-tip{
			font-size:28rpx;
			font-family:PingFang;
			/* font-weight:500; */
			color:#333333;
			line-height:55rpx;
			
			&.unBind {
				color: #D21728;
			}
			&.unSet {
				color: #999999;
			}
		}
	}
</style>



